﻿@model IEnumerable<MvcMusicStore.Models.Album>
@using MvcMusicStore.Helpers

@{
    ViewBag.Title = "Store Manager - All Albums";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>Title</th>
        <th>Artist</th>
        <th>Genre</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.AlbumId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.AlbumId })
        </td>
        <td>@Html.Truncate(item.Title, 25) </td>
        <td>@Html.Truncate(item.Artist.Name, 25)</td>
        <td>@item.Genre.Name</td>
    </tr>
}

</table>

